//
// Created by Semir on 2020/4/22.
//

#include <iostream>
#include <cstring>

using namespace std;

const int MAX_M = 1005;
int n;
int arr[MAX_M];

int main() {
    memset(arr, 0, sizeof(arr));
    int count = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int num;
        cin >> num;
        if (arr[num] == 0) {
            count++;
        }
        arr[num] = 1;
    }
    cout << count << endl;
    for (int i = 0; i <= MAX_M; i++) {
        if (arr[i] == 1) {
            cout << i << " ";
        }
    }
    return 0;
}